import Relay from "react-relay";

export default class SampleSchduleMutation extends Relay.Mutation {

    static fragments = {};

    getMutation() {
        return Relay.QL`mutation { sampleSchdule  }`;
    }

    getVariables() {
        return {
            argsInput: {
                orderId: this.props.orderId,
            }
        };
    }

    getFatQuery() {
        return Relay.QL`fragment on sampleSchdulePayload {
            responseData {
                errorCode 
                id
                value 
                userId
                token 
                totalResult 
                samplePlanModels{
                    deliveryDate 
                    sendNum 
                    spId 
                    finishNum 
                    scId 
                    status 
                    startNum 
                    name 
                    goodsList{
                        statusDesc
                        styleNo
                        reply
                        logisticsInfo
                        gspId
                        scId
                        productName
                        startDate
                        status 
                        gId 
                        size 
                        sampleId
                        num 
                    }            
                    size 
                    sampleId 
                    isClick
                }
                fileJson 
                authorityId  
                mark  
                sampleCreate{
                    enterpriseName 
                    username 
                    createDate 
                    scId 
                    mark 
                    enterpriseId 
                    orderId 
                    fileJSON 
                    uid 
                    approveType 
                } 
            }
        }`;
    }

    getConfigs() {
        return [{
            type: 'REQUIRED_CHILDREN',
            children: [Relay.QL`
               fragment on sampleSchdulePayload {
                    responseData {
                        errorCode 
                        id
                        value 
                        userId
                        token 
                        totalResult 
                        samplePlanModels{
                            deliveryDate 
                            sendNum 
                            spId 
                            finishNum 
                            scId 
                            status 
                            startNum 
                            name 
                            goodsList{
                                statusDesc
                                styleNo
                                reply
                                logisticsInfo
                                gspId
                                scId
                                productName
                                startDate
                                status 
                                gId 
                                size 
                                sampleId
                                num 
                            }
                            size 
                            sampleId 
                            isClick
                        }
                        fileJson 
                        authorityId  
                        mark  
                        sampleCreate{
                            enterpriseName 
                            username 
                            createDate 
                            scId 
                            mark 
                            enterpriseId 
                            orderId 
                            fileJSON 
                            uid 
                            approveType 
                        } 
                    }
                }
            `]
        }];
    }

}